<?php

namespace App\Models\Trip\TripOrderCosts\Repositories\Interfaces;

use App\Models\Orders\Repositories\Interfaces\OrdersInterface;
use App\Models\Trip\TripOrderCosts\TripOrderCost;
use Illuminate\Support\Collection;

interface TripOrderCostsRepositoryInterface
{
    public function listByUserTrip(string $user_id, string $trip_id): Collection;

    public function addOne(OrdersInterface $order, array $data): TripOrderCost;

    public function updateOne(TripOrderCost $cost, array $data): bool;

    public function updatePaySnByOrder(OrdersInterface $order, string $pay_sn, array $types = []): bool;

    public function addMore(OrdersInterface $order, array $datas): bool;

    public function listByOrder(OrdersInterface $order, array $condition = [], array $excepts = []): Collection;

    /**
     * 查找价格明细记录
     * @param OrdersInterface $order 订单
     * @param int             $type 类型
     * @param string          $name 名称
     * @param string          $pay_sn 支付单号
     * @return TripOrderCost|null
     */
    public function findOneByOrderAndTypeName(OrdersInterface $order, int $type, string $name, string $pay_sn = ''): ?TripOrderCost;

    // 获取票价相关的成本明细
    public function getOrderPassengersTicketCosts(OrdersInterface $order): Collection;

    public function addByNewOrderTicketCost(OrdersInterface $order, array $cost): bool;
}